package CS;

import java.util.Scanner;

public class Demo2 {
    public static void main(String[] args) {
        int sum = 2;
        int count = 0;
        int countSum = 0;
        int num = 2;
        while (countSum<1000){
            count = 0;
            for (int i = 1; i*i <num ; i++) {
                if (num%i ==0){
                    count++;
                }
                if (count>2)break;
            }
            if (count==2){
                countSum++;
                sum += num;
            }
            num++;
        }
        System.out.println(sum);

    }
}
